﻿@{
    ViewBag.Title = T("Admin.Configuration.DeliveryTimes").Text;
}
<div class="section-header">
    <div class="title">
		<i class="far fa-clock"></i>
        @T("Admin.Configuration.DeliveryTimes")
    </div>
    <div class="options">
        <a href="@Url.Action("Create")" class="btn btn-primary">
            <i class="fa fa-plus"></i>
            <span>@T("Admin.Common.AddNew")</span>
        </a>
    </div>
</div>

<div>

	@(Html.Telerik().Grid<DeliveryTimeModel>()
		.Name("delivery-times-grid")
		.Columns(columns =>
		{
			columns.Bound(x => x.Name)
				.ClientTemplate("<a href='Edit/<#= Id #>'><#= Name #></a>");
			columns.Bound(x => x.ColorHexValue)
				.ClientTemplate("<span class='color-container'><span class='color' style='background:<#= ColorHexValue #>'>&nbsp;</span></span><span><#= ColorHexValue #></span>")
				.Width(200);
			columns.Bound(x => x.DisplayOrder)
				.Centered()
				.Width(200);
			columns.Bound(x => x.IsDefault)
				.ClientTemplate(@Html.SymbolForBool("IsDefault"))
				.Centered()
				.Width(200);
		})
		.DataBinding(dataBinding => dataBinding.Ajax().Select("List", "DeliveryTime"))
		.PreserveGridState()
		.EnableCustomBinding(true)
	)
</div>